/**
 * Created by asus on 2016/11/21.
 */
import React, { Component,PropTypes  } from 'react';
import {Link} from 'react-router';
import '../../Stylesheets/wx/personalCenter.css'


export default class TitleClassify extends Component {
    static contextTypes = {
        router:PropTypes.object
    }
    // 构造
    constructor(props) {
        super(props);
        // 初始状态
        this.state = {
            show:'none',
            index:this.props.index,
            titleCon:'',
            content:''
        };
    }
    componentWillUnmount() {

    }

    show(a){
        this.context.router.push({pathname:'/tip',query:{index:a}})
    }

    render(){
        const {title,img} = this.props
        const {index,show,titleCon,content} = this.state
        return(
            <div className="flex flex-align-center pl width100" style={{height:'2.5rem'}}>
                <span>
                    <span className="di border_raAll splitLine" style={{width:20,height:20,lineHeight:0}}>
                        <img src={img} alt=""/>
                    </span>
                    <span className="f16 color6">{title}</span>
                    <span className="di border_raAll splitLine"
                          style={{width:20,height:20,lineHeight:0,marginLeft:15}}
                          onClick = {()=>this.show(index)}
                    >
                        <img src={require('../../Images/explain.png')} alt=""/>
                    </span>
                </span>
            </div>
        )
    }
}
